<?php


namespace App\Models\Select;

use App\Common\Libs\ArrayHelper;

class ArticleSelect extends BaseSelect
{
    // 消息静态化
    public const MESSAGE_STATIC = 'messageStatic';

    // 笔记
    public const NOTE = 'note';

    // 举报
    public const REPORT = 'report';

    // 动态
    public const DYNAMIC = 'dynamic';

    // 点赞
    public const LIKE = 'like';

    public static function getSelects($scene = self::SELF_DETAIL): array
    {
        $baseSelects = [
            'id',
            'article_id',
            'author_id',
            'cover_url',
            'title',
            'description',
            'type',
            'is_deleted',
            'is_shield',
            'created_at',
        ];

        $selects = [
            self::MESSAGE_STATIC => [
                'id',
                'article_id',
                'title',
                'cover_url',
                'description',
                'type',
                'is_deleted',
                'is_shield',
            ],

            self::DYNAMIC => $baseSelects,
            self::NOTE => $baseSelects,

            self::SELF_DETAIL => ArrayHelper::merge($baseSelects, [
                'original_url'
            ]),

        ];


        return $selects[$scene] ?? $baseSelects;
    }
}
